package com.str.PQ;
class Person implements Comparable {

  // Each Person value consists of a person's surname, forename, gender,
  // and year of birth.
  String firstName, lastName;
  int yearOfBirth;

  Person(String first, String last, int year) {
    firstName = first;
    lastName = last;
    yearOfBirth = year;
  }
   
  public int compareTo(Object that) {
    Person other = (Person) that;
    int d = lastName.compareTo(other.lastName);
    if (d != 0)
      return d;
    else
      return firstName.compareTo(other.firstName);
    // return yearOfBirth - other.yearOfBirth;
  }
  
  public String toString () {
  	return firstName + " " + lastName +
  	       ", " + yearOfBirth;
  }
}
  